<?php
 include("../funcs/funcs.php");
 $conn=localConnectUsm();
 //$conn=connect("192.168.1.88,1433","temp","sa","");
 //if($_POST["nosave"]){
   $sql="select * from Class where zyCode='".$_POST[majorName]."'";
   //echo $sql."<br>";
  $rs = mssql_query($sql);
  echo "<script language='javascript'>
         obj=top.frames['main'].document.getElementById('classNames');
		 for(i=1;i<obj.length;)
           obj.options[i]=null;";
  while($row=@mssql_fetch_array($rs)){
	echo "op = new Option();
	      op.value = '".$row['classCode']."';
		  op.text ='".$row['className']."';
		  obj.add(op);";
		  
  }
  
?>
      /*if(obj.length>0)
        obj.selectedIndex=1;*/
	 
</script>